/*
 * TestAlgo.java
 * 
 *  author: Daniel Rudigier
 *    date: 10.12.2008
 * 
 * 
 */
package at.syncme.aspects.algorithm;

import at.syncme.framework.Algorithm;
import at.syncme.framework.Event;
import at.syncme.framework.Network;

/**
 * dummy synhronization implementation
 * 
 * @author Daniel Rudigier
 */
public class DummySync extends Algorithm {

    /**
     * constructor
     * 
     * @param nw
     */
    public DummySync(Network nw) {
        super(nw);
    }

    /**
     * override
     * 
     * @see at.syncme.framework.Algorithm#eventReceived(at.syncme.framework.Event)
     */
    public void eventReceived(Event e) {
        game.gameEvent(e);
    }

    /**
     * override
     * 
     * @see at.syncme.framework.Algorithm#sendEvent(at.syncme.framework.Event)
     */
    public void sendEvent(Event e) {
        network.sendToAllNodes(e);
    }

    /**
     * override
     * 
     * @see java.lang.Runnable#run()
     */
    public void run() {
        while (game.isRunning()) {
            beFair();
        }
    }

}
